home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 70 / examples / examples.arc / FIB.ST < prev    next >
Text File  |  1985-11-20  |  258b  |  13 lines

  1. Class Fib :Generator
  2. | lastNumber  nextToLastNumber |
  3. [
  4.     first
  5.             nextToLastNumber <- 0.
  6.             ^ lastNumber <- 1
  7. |
  8.       next            | sum |
  9.             sum <- nextToLastNumber + lastNumber.
  10.             nextToLastNumber <- lastNumber.
  11.             ^ lastNumber <- sum
  12. ]
  13.